package arithmetic.LeetCode.Find_All_Numbers_Disappeared_in_an_Array;

import java.util.LinkedList;
import java.util.List;

/**
 * @author zhangyanqi
 * @since 1.0 2017/10/11
 */
public class Solution {
    public List<Integer> findDisappearedNumbers(int[] nums) {

        List<Integer> list = new LinkedList<>();
        int length = nums.length;
        int[] mark = new int[length + 1];
        for (int i = 0; i < length; i++) {
            mark[nums[i]] = 1;
        }
        for (int j = 1; j < length + 1; j++) {
            if (mark[j] == 0) {
                list.add(j);
            }
        }
        return list;
    }
}
